Release 10.1A: OpenEdge Application Server:
Developing WebSpeed Applications


html-encode

This function converts various characters that can be misinterpreted as HTML formatting to their HTML entity representation. The characters <, >, & and " (double quote) are converted to &lt;, &gt;, &amp;, and &quot; respectively.

Location: web\method\cgiutils.i

Parameters:

INPUT p_in AS CHARACTER

The character string to encode.

Returns: CHARACTER

Notes: This function cannot be called more than once on a string. This is because ampersands are replaced with &amp; and recursive calls will fail.

Examples:

PROCEDURE displayFields:
\*-------------------------------------------------------------------------
Purpose: Override standard ADM method
-------------------------------------------------------------------------*\

RUN SUPER.

\* The comment field may contain <, >, quotes and ampersands. To be safe, 
convert these characters. *\
IF AVAILABLE Customer THEN
  Customer.Comments:SCREEN-VALUE IN FRAME {&FRAME-NAME} = 
  html-encode(Customer.Comments).
END PROCEDURE. 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095